# 使用redis作为任务队列
from core.setting import settings

broker_url = "redis://{}:{}/3".format(settings.REDIS_HOST, settings.REDIS_PORT)

# 设置时区
timezone = 'Asia/Shanghai'

# 启动时区设置
CELERY_ENABLE_UTC = True
celery_enable_utc = True

task_serializer = "pickle"
result_serializer = "json"

# celery任务执行结果的超时时间
result_expires = 24 * 60 * 60

# 单个任务的运行时间限制，否则会被杀死
# task_time_limit = 1800

accept_content = ['pickle', 'json', 'yaml']

# 并发的worker数量
celery_concurrency = 10
# celery worker每次去redis取任务的数量
worker_prefetch_multiplier = 10
# 每个worker执行了多少次任务后就会死掉
worker_max_tasks_per_child = 100

# 导入指定的任务模块
imports = (
    # "celery_task.diffbot_collection.diffbot_task",
)
